﻿$(function () {
    var url = 'http://localhost:53153';
    //检测IE
    if ('undefined' == typeof (document.body.style.maxHeight)) {
        window.location.href = '/ie6update.html';
    }
    $(".login-btn").click(function () {
        if ($("#UserName").val() == "" || $("#password").val() == "") {
            $("#msgtip").val("请输入用户名和密码");
            return false;
        }
        $.post(url + "/Login/Login?userName=" + $("#UserName").val() + "&password=" + $("#password").val(),
            function (result) {
                console.log(result);
                if (result != 1) { $("#msgtip").html(result); alert(result); }
                else
                    window.location.href = '/Home/Index';
            }
        ).error(function (data) {
            console.log(data);
            alert(data);
        });
    })
});